package com.example.mobile2021606159yhf0401;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.media.Image;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    private ImageView ivMainLight;
    private Button btnMainLigthOn;
    private Button btnMainLigthOff;
    private Button btnMainFan;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

        btnMainFan.setOnClickListener(new View.OnClickListener() {
    @Override
            public void onClick(View v){
        ivMainLight.setImageResource(R.drawable.on);
    }
        });
    }


    private void initView(){
        ivMainLight = (ImageView) findViewById(R.id.imageView);
        btnMainLigthOn = (Button) findViewById(R.id.bon);
        btnMainLigthOn = (Button) findViewById(R.id.b);

    }
}